package com.wecan.api.saasdata;

import com.wecan.base.PO.Order;
import com.wecan.base.VO.OrderDetailVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Author liuzhihao
 * @Date 2022.02.24
 * @Version ${version}
 * @Description ${description}
 */
@FeignClient(name = "saasdata", path = "/order")
public interface OrderData {

    @PostMapping(value = "/querybyid")
    Order queryById(@RequestParam("id") Long id);

    @PostMapping(value = "/querybyuserid")
    Order queryByUserId(@RequestBody Order order);

    @PostMapping(value = "/querylist")
    List<Order> queryList(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestBody Order order);

    @PostMapping(value = "/add")
    Long addOrder(@RequestBody Order order);

    @PostMapping(value = "/selectonebyorder")
    Order selectOneByOrder(@RequestBody Order order);

    @PostMapping(value = "/updatestatus")
    boolean updateOrderStatus(@RequestBody Order order);

    @PostMapping(value = "/queryhaspay")
    List<Order> queryHasPay(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestParam("userId") Long userId);

    @PostMapping(value = "/queryhasdone")
    List<Order> queryHasDone(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize, @RequestParam("userId") Long userId);

    @PostMapping(value = "/querydetail")
    OrderDetailVO queryDetail(@RequestParam("userId") Long userId, @RequestParam("orderId") Long orderId);

    @PostMapping(value = "/delete")
    int delete(@RequestParam("orderId") Long orderId);
}
